﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace Config
{
    public class ChannelList
    {
        XmlNode _xmlNode = null;
        XmlDocument _xmlDoc = null;
        private List<Channel> _list = null;
        public ChannelList(XmlNode Node)
        {
            if (Node == null)
            {
                throw new XmlException("Node is equal null");
            }
            _xmlNode = Node;
            _xmlDoc = _xmlNode.OwnerDocument;
            
        }
        public XmlNode XmlNode
        {
            get
            {
                return _xmlNode;
            }
        }
        public void AddChannel(int id)
        {
            try
            {
                XmlNode node = _xmlDoc.CreateElement("channel");
                Channel ch = new Channel(node);
                ch.Initial();
                ch.No = id;
                _xmlNode.AppendChild(ch.Node);
            }
            catch(Exception ex)
            {

            }
        }
        
        public List<Channel> Channels
        {
            get
            {
                // List<BaseNode> lst = new List<BaseNode>();
                Channel c = null;

                if (null != _list)
                    _list.Clear();
                else
                    _list = new List<Channel>();

                foreach (XmlNode x in _xmlNode.SelectNodes("channel"))
                {
                    c = new Channel(x);
                    //  BaseNode b = c as BaseNode;
                    _list.Add(c);
                }
                //lst.Sort(delegate(BaseNode x, BaseNode y) { return x.id.CompareTo(y.id); });
                //foreach (BaseNode b in lst)
                //{
                //    _list.Add(b as Cls_Channel);
                //}
                _list.Sort();
                return _list;
            }
        }
    }
    public class Channel:BaseNode
    {
        public Channel(XmlNode Node):base(Node)
        {
            if (Node == null)
            {
                throw new XmlException("Node is equal null");
            }
        }
        public void Initial()
        {
            _xmlNode.Attributes.Append(_xmlDoc.CreateAttribute("NO")).Value = "";
            XmlNode node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("channelname"));
            node.InnerText = "";
            node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("enable"));
            node.InnerText = "";                
        }
        //public int No
        //{
        //    get
        //    {
        //        if (_xmlNode.Attributes["NO"] == null)
        //        {
        //            return -1;
        //        }
        //        return int.Parse(_xmlNode.Attributes["NO"].Value);
        //    }
        //    set
        //    {
        //        if (_xmlNode.Attributes["NO"] == null)
        //        {
        //            XmlDocument doc = _xmlNode.OwnerDocument;
        //            _xmlNode.Attributes.Append(doc.CreateAttribute("NO")).Value = value.ToString();
        //        }
        //        else
        //            _xmlNode.Attributes["NO"].Value = value.ToString();
        //    }
        //}
        public List<string> ChildNodeName()
        {
            List<string> names = new List<string>();
            int count = _xmlNode.ChildNodes.Count;
            foreach (XmlNode child in _xmlNode)
            {
                names.Add(child.Name);
            }
            return names;
        }
        public List<string> ChildNodeValue()
        {
            List<string> names = new List<string>();
            int count = _xmlNode.ChildNodes.Count;
            foreach (XmlNode child in _xmlNode)
            {
                names.Add(child.InnerText);
            }
            return names;
        }
        public string ChannelName
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                if (_xmlNode["channelname"] != null)
                    return _xmlNode["channelname"].InnerText;
                else
                    return "";
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("channelname");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("channelname"));
                Node.InnerText = value.ToString();
            }
        }
        public int Enable
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["enable"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("enable");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("enable"));
                Node.InnerText = value.ToString();
            }
        }
<<<<<<< HEAD
        public int FlagIsUser
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["FlagIsUser"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("FlagIsUser");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("FlagIsUser"));
                Node.InnerText = value.ToString();
            }
        }
=======
>>>>>>> b19c74022a89f58c8c960e2031f2461983bbb895
        //<speedno>1</speedno>
        public int SpeedNo
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["speedno"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("speedno");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("speedno"));
                Node.InnerText = value.ToString();
            }
        }
        //<alarm>880</alarm>
        public float Alarm
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["alarm"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("alarm");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("alarm"));
                Node.InnerText = value.ToString();
            }
        }
        //<warning>600</warning>
        public float Warning
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["warning"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("warning");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("warning"));
                Node.InnerText = value.ToString();
            }
        }
        //<strFixAngle>90</strFixAngle>
        public float FixAngle
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strFixAngle"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strFixAngle");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strFixAngle"));
                Node.InnerText = value.ToString();
            }
        }
        //<nSensorType>0</nSensorType>
        public int SensorType
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["nSensorType"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("nSensorType");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("nSensorType"));
                Node.InnerText = value.ToString();
            }
        }
        //<strLingMinDu>1</strLingMinDu>
        public float Sensitivity
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strLingMinDu"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strLingMinDu");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strLingMinDu"));
                Node.InnerText = value.ToString();
            }
        }
        //<strAdjustFactor>1</strAdjustFactor>
        public float AdjustFactor
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strAdjustFactor"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strAdjustFactor");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strAdjustFactor"));
                Node.InnerText = value.ToString();
            }
        }
        //<strZeroOffset>0</strZeroOffset>
        public float ZeroOffset
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strZeroOffset"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strZeroOffset");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strZeroOffset"));
                Node.InnerText = value.ToString();
            }
        }
        //<strPianYiLiang>0</strPianYiLiang>
        public float PianYiLiang
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strPianYiLiang"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strPianYiLiang");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strPianYiLiang"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin1Name>p1</strOptionPin1Name>
        public string OptionPin1Name
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                return _xmlNode["strOptionPin1Name"].InnerText;
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin1Name");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin1Name"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin2Name>p2</strOptionPin2Name>
        public string OptionPin2Name
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                return _xmlNode["strOptionPin2Name"].InnerText;
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin2Name");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin2Name"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin3Name>p3</strOptionPin3Name>
        public string OptionPin3Name
        {
            get
            {
                if (_xmlNode == null)
                {
                    return "";
                }
                return _xmlNode["strOptionPin3Name"].InnerText;
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin3Name");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin3Name"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin1UpThreshold>1.1</strOptionPin1UpThreshold>
        public float OptionPin1UpThreshold
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin1UpThreshold"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin1UpThreshold");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin1UpThreshold"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin1DownThreshold>0.9</strOptionPin1DownThreshold>
        public float OptionPin1DownThreshold
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin1DownThreshold"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin1DownThreshold");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin1DownThreshold"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin1Warning>130</strOptionPin1Warning>
        public float OptionPin1Warning
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin1Warning"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin1Warning");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin1Warning"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin1Alarm>140</strOptionPin1Alarm>
        public float OptionPin1Alarm
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin1Alarm"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin1Alarm");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin1Alarm"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin2UpThreshold>2.1</strOptionPin2UpThreshold>
        public float OptionPin2UpThreshold
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin2UpThreshold"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin2UpThreshold");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin2UpThreshold"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin2DownThreshold>1.9</strOptionPin2DownThreshold>
        public float OptionPin2DownThreshold
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin2DownThreshold"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin2DownThreshold");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin2DownThreshold"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin2Warning>150</strOptionPin2Warning>
        public float OptionPin2Warning
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin2Warning"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin2Warning");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin2Warning"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin2Alarm>160</strOptionPin2Alarm>
        public float OptionPin2Alarm
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin2Alarm"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin2Alarm");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin2Alarm"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin3UpThreshold>0.6</strOptionPin3UpThreshold>
        public float OptionPin3UpThreshold
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin3UpThreshold"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin3UpThreshold");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin3UpThreshold"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin3DownThreshold>0.4</strOptionPin3DownThreshold>
        public float OptionPin3DownThreshold
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin3DownThreshold"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin3DownThreshold");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin3DownThreshold"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin3Warning>170</strOptionPin3Warning>
        public float OptionPin3Warning
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin3Warning"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin3Warning");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin3Warning"));
                Node.InnerText = value.ToString();
            }
        }
        //<strOptionPin3Alarm>180</strOptionPin3Alarm>
        public float OptionPin3Alarm
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strOptionPin3Alarm"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strOptionPin3Alarm");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strOptionPin3Alarm"));
                Node.InnerText = value.ToString();
            }
        }
        //<strFrequency1Warning>70</strFrequency1Warning>
        public float Frequency1Warning
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strFrequency1Warning"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strFrequency1Warning");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strFrequency1Warning"));
                Node.InnerText = value.ToString();
            }
        }
        //<strFrequency1Alarm>80</strFrequency1Alarm>
        public float Frequency1Alarm
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strFrequency1Alarm"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strFrequency1Alarm");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strFrequency1Alarm"));
                Node.InnerText = value.ToString();
            }
        }
        //<strFrequency2Warning>90</strFrequency2Warning>
        public float Frequency2Warning
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strFrequency2Warning"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strFrequency2Warning");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strFrequency2Warning"));
                Node.InnerText = value.ToString();
            }
        }
        //<strFrequency2Alarm>100</strFrequency2Alarm>
        public float Frequency2Alarm
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strFrequency2Alarm"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strFrequency2Alarm");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strFrequency2Alarm"));
                Node.InnerText = value.ToString();
            }
        }
        //<strFrequencyHalfWarning>110</strFrequencyHalfWarning>
        public float FrequencyHalfWarning
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strFrequencyHalfWarning"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strFrequencyHalfWarning");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strFrequencyHalfWarning"));
                Node.InnerText = value.ToString();
            }
        }
        //<strFrequencyHalfAlarm>120</strFrequencyHalfAlarm>
        public float FrequencyHalfAlarm
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["strFrequencyHalfAlarm"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("strFrequencyHalfAlarm");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("strFrequencyHalfAlarm"));
                Node.InnerText = value.ToString();
            }
        }
<<<<<<< HEAD
        
        public int batched
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["batched"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("batched");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("batched"));
                Node.InnerText = value.ToString();
            }
        }
=======
>>>>>>> b19c74022a89f58c8c960e2031f2461983bbb895
        //<blTongPinEnable>0</blTongPinEnable>
        //<blOptionPin1Enable>0</blOptionPin1Enable>
        public int OptionPin1Enable
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["blOptionPin1Enable"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("blOptionPin1Enable");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("blOptionPin1Enable"));
                Node.InnerText = value.ToString();
            }
        }
        //<blOptionPin2Enable>0</blOptionPin2Enable>
        public int OptionPin2Enable
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["blOptionPin2Enable"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("blOptionPin2Enable");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("blOptionPin2Enable"));
                Node.InnerText = value.ToString();
            }
        }
        //<blOptionPin3Enable>0</blOptionPin3Enable>
        public int OptionPin3Enable
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["blOptionPin3Enable"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("blOptionPin3Enable");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("blOptionPin3Enable"));
                Node.InnerText = value.ToString();
            }
        }
        //<blFrequency1Enable>0</blFrequency1Enable>
        public int Frequency1Enable
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["blFrequency1Enable"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("blFrequency1Enable");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("blFrequency1Enable"));
                Node.InnerText = value.ToString();
            }
        }
        //<blFrequency2Enable>0</blFrequency2Enable>
        public int Frequency2Enable
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["blFrequency2Enable"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("blFrequency2Enable");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("blFrequency2Enable"));
                Node.InnerText = value.ToString();
            }
        }
        //<blFrequencyHalfEnable>0</blFrequencyHalfEnable>
        public int FrequencyHalfEnable
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["blFrequencyHalfEnable"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("blFrequencyHalfEnable");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("blFrequencyHalfEnable"));
                Node.InnerText = value.ToString();
            }
        }
<<<<<<< HEAD
=======
       
>>>>>>> b19c74022a89f58c8c960e2031f2461983bbb895
        //<AccHighAmplitudeYellowValue>0</AccHighAmplitudeYellowValue>
        public float AccHighAmplitudeYellowValue
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["AccHighAmplitudeYellowValue"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccHighAmplitudeYellowValue");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccHighAmplitudeYellowValue"));
                Node.InnerText = value.ToString();
            }
        }
        //<AccHighAmplitudeRedValue>0</AccHighAmplitudeRedValue>
        public float AccHighAmplitudeRedValue
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["AccHighAmplitudeRedValue"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccHighAmplitudeRedValue");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccHighAmplitudeRedValue"));
                Node.InnerText = value.ToString();
            }
        }
        //<AccHighAmplitudeValueIsUser>0</AccHighAmplitudeValueIsUser>
        public int AccHighAmplitudeValueIsUser
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["AccHighAmplitudeValueIsUser"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccHighAmplitudeValueIsUser");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccHighAmplitudeValueIsUser"));
                Node.InnerText = value.ToString();
            }
        }
<<<<<<< HEAD
=======
        public int FlagIsUser
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["FlagIsUser"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("FlagIsUser");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("FlagIsUser"));
                Node.InnerText = value.ToString();
            }
        }
>>>>>>> b19c74022a89f58c8c960e2031f2461983bbb895
        //<AccLowAmplitudeYellowValue>0</AccLowAmplitudeYellowValue>
        public float AccLowAmplitudeYellowValue
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["AccLowAmplitudeYellowValue"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccLowAmplitudeYellowValue");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccLowAmplitudeYellowValue"));
                Node.InnerText = value.ToString();
            }
        }
        //<AccLowAmplitudeRedValue>0</AccLowAmplitudeRedValue>
        public float AccLowAmplitudeRedValue
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["AccLowAmplitudeRedValue"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccLowAmplitudeRedValue");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccLowAmplitudeRedValue"));
                Node.InnerText = value.ToString();
            }
        }
        //<AccLowAmplitudeValueIsUser>0</AccLowAmplitudeValueIsUser>
        public int AccLowAmplitudeValueIsUser
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["AccLowAmplitudeValueIsUser"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccLowAmplitudeValueIsUser");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccLowAmplitudeValueIsUser"));
                Node.InnerText = value.ToString();
            }
        }
        //<AccTotalAmplitudeYellowValue>0</AccTotalAmplitudeYellowValue>
        public float AccTotalAmplitudeYellowValue
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["AccTotalAmplitudeYellowValue"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccTotalAmplitudeYellowValue");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccTotalAmplitudeYellowValue"));
                Node.InnerText = value.ToString();
            }
        }
        //<AccTotalAmplitudeRedValue>0</AccTotalAmplitudeRedValue>
        public float AccTotalAmplitudeRedValue
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1.0f;
                }
                return float.Parse(_xmlNode["AccTotalAmplitudeRedValue"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccTotalAmplitudeRedValue");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccTotalAmplitudeRedValue"));
                Node.InnerText = value.ToString();
            }
        }
        //<AccTotalAmplitudeValueIsUser>0</AccTotalAmplitudeValueIsUser>
        public int AccTotalAmplitudeValueIsUser
        {
            get
            {
                if (_xmlNode == null)
                {
                    return -1;
                }
                return int.Parse(_xmlNode["AccTotalAmplitudeValueIsUser"].InnerText);
            }
            set
            {
                XmlNode Node = _xmlNode.SelectSingleNode("AccTotalAmplitudeValueIsUser");
                if (Node == null)
                    Node = _xmlNode.AppendChild(_xmlNode.OwnerDocument.CreateElement("AccTotalAmplitudeValueIsUser"));
                Node.InnerText = value.ToString();
            }
        }
    }
}
